<div id="pages_category_list_list" class="scroll" style="height:100%;display:none;"><master title="商品分类">
  <div class="addFirst addDiv">
    <span class="btn add" data-index="" @click="add">+ 一级分类</span>
  </div>
  <div v-for="(item,index) in tree" key="id" class="list">
    <div class="itemDiv">
      <div v-if="item.children.length" class="arrow" :data-index="index" @click="change">
        <img class="arrowImg" v-if="item.opened" src="/images/arrow_grey_down.png"></img>
        <img class="arrowImg" v-else src="/images/arrow_grey_right.png"></img>
      </div>
      <span v-else class="arrowHide"></span>
      <span class="itemName">{{item.name}}</span>
      <span class="btn" :data-index="index" @click="edit">编辑</span>
      <span class="btn other" :data-index="index" @click="editProduct">产品</span>
      <span v-if="!item.children.length" class="btn delet" :data-index="index" @click="delet">删除</span>
    </div>
    <div v-if="item.opened" class="listChild">
      <div v-if="item.children.length" key="id" v-for="(item1,index1) in item.children">
        <div class="itemDiv">
          <div v-if="item1.children.length" class="arrow" :data-index="index + ',' + index1" @click="change">
            <img class="arrowImg" v-if="!item1.opened" src="/images/arrow_grey_down.png"></img>
            <img class="arrowImg" v-else src="/images/arrow_grey_right.png"></img>
          </div>
          <span v-else class="arrowHide"></span>
          <span class="itemName">{{item1.name}}</span>
          <span class="btn" :data-index="index + ',' + index1" @click="edit">编辑</span>
          <span class="btn" :data-index="index + ',' + index1" @click="editProduct">产品</span>
          <span v-if="!item1.children.length" class="btn delet" :data-index="index + ',' + index1" @click="delet">删除</span>
        </div>
        <div v-if="!item1.opened" class="listChild">
          <div v-for="(item2,index2) in item1.children" key="id">
            <div class="itemDiv">
              <span class="arrowHide"></span>
              <span class="itemName">{{item2.name}}</span>
              <span class="btn" :data-index="index + ',' + index1 + ',' + index2" @click="edit">编辑</span>
              <span class="btn" :data-index="index + ',' + index1 + ',' + index2" @click="editProduct">产品</span>
              <span class="btn delet" :data-index="index + ',' + index1 + ',' + index2" @click="edit">删除</span>
            </div>
          </div>
          <div class="addDiv">
            <span class="arrowHide"></span>
            <span class="btn add" :data-index="index + ',' + index1" @click="add">+ {{item1.name}}子分类</span>
          </div>
        </div>
      </div>
      <div class="addDiv">
        <span class="arrowHide"></span>
        <span class="btn add" :data-index="index" @click="add">+ {{item.name}}子分类</span>
      </div>
    </div>
  </div>
</master></div>
<script type="text/javascript">
(function (G) {
  G.vue("pages_category_list_list",{
  "usingComponents": {
    "master": "/components/Master/Master"
  }
},G.classifyList({
    modelName:'category',
    nickName:'分类',
    pageUrl:'/pages/product/list/list?key={name}&categoryId={id}'
  },{
    methods:{
      editProduct:function(event){
        this.getItem(event, function (item) {
          this.$go(G.string('/pages/category/product/product?id=%s&name=%s').Format(item.id,item.name));
        })
      }
    }
  }))
})(Y)
</script>